|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/matalashes/.trash/app/Views/admin/pages/custom/report/reportmekanik/ |
Upload File : |
<?= $this->extend('admin/layout/report/admin_report_blank') ?>
<?= $this->section('content') ?>
<!-- ============================================================== -->
<!-- Page Content -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Different data widgets -->
<!-- ============================================================== -->
<?php echo form_open($url_action_table['main']); ?>
<div class="row">
<div class="col-md-6">
<div class="fv-row mb-5">
<label class="form-label fw-bold">Nama Mekanik</label>
<select class="form-control form-control-sm" name="mekanik" id="mekanik">
<?php foreach ($_mekanik as $d) { ?>
<option value="<?= $d->mm_id ?>"> <?= $d->mm_name ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-3">
<div class="fv-row mb-5">
<label class="form-label fw-bold">Start</label>
<?= input_field('start', 'form-control form-control-lg', 'start', 'date', 'Start', $start); ?>
</div>
</div>
<div class="col-md-3">
<div class="fv-row mb-5">
<label class="form-label fw-bold">End</label>
<?= input_field('end', 'form-control form-control-lg', 'end', 'date', 'End', $end); ?>
</div>
</div>
<div class="col-md-3">
<div class="fv-row mb-5">
<!-- <label class="form-label fw-bold"> </label> -->
<?= button_button('', 'btn btn-light-primary', 'rpt', 'submit','value="export"', '', 'Export Excel'); ?>
<?= button_button('', 'btn btn-light-primary', 'rpt', 'submit','value="show"', '', 'Show Data'); ?>
</div>
</div>
<?= form_close() ?>
<!-- ============================================================== --> <?php
if($show){
$session = service('session');
echo form_content_table_tag_open('table', 'table align-middle table-row-dashed fs-6 gy-5', '', $session->get('trash')) ?>
<thead>
<tr class="text-start text-muted fw-bolder fs-7 text-uppercase gs-0">
<th>Tgl</th>
<th>No Faktur</th>
<th>Jasa</th>
<th>Total</th>
<th>Tipe Fee</th>
<th>Nominal</th>
<th>Total Fee</th>
<th class="text-end">#</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-bold">
<?php foreach ($data as $d) {
$json = json_decode($d->ps_item_service_wo2);
$sum = 0;
?>
<?php
foreach($json as $j){
$o = $j->item;
$q = $j->qty;
$p = $j->price;
$v = $j->mekanik;
$sum += $q*$p;
if(isset($o) && $o != ''){
$flag = false;
foreach($v as $m){
if($m == $_mekanik_id){
$flag = true;
}
}
if($flag){
$service = new \App\Models\MasterService();
$_item = $service->find($o);
$_item_name = $_item->msc_type;
if($datas->mm_fee != NULL){
$json_fee = json_decode($datas->mm_fee);
$fee = 0;
foreach($json_fee as $f){
$msc_id = $f->msc_id;
if($msc_id == $o){
$fee_type = $f->type;
$fee_amount = $f->fee;
if ($fee_type == 'percent') {
$fee = $sum * ($fee_amount / 100);
} else {
$fee = $fee_amount;
}
}
}
?>
<tr>
<td><?= date("d M Y H:i", strtotime($d->created_at ?? '')) ?></td>
<td><?= $d->ps_no ?></td>
<td><?= $_item_name ?></td>
<td><?= $sum ?></td>
<td><?= $fee_type ?></td>
<td><?= $fee_amount ?></td>
<td><?= $fee ?></td>
<td> </td>
</tr>
<?php
}
}
}
}
?>
<?php
}
?>
</tbody>
<?= form_content_table_tag_close(); ?>
<?php } ?>
<?= $this->endSection('content') ?>